package com.example.x1c.uitest;


import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity{
    private static final String TAG = "MainActivity";

    private EditText editText;

    private ImageView imageView;

    private ProgressBar progressBar;

    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        Log.d(TAG, "onCreate: ");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ActionBar actionBar = getSupportActionBar();

        if(actionBar!=null){
            actionBar.hide();
        }


//        Button btn1 = (Button) findViewById(R.id.button_1);
//        btn1.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                // 监听器的onclick方法。
//            }
//        });

//        editText = (EditText) findViewById(R.id.edit_text);
//        imageView = (ImageView) findViewById(R.id.image_1);
//        progressBar = (ProgressBar) findViewById(R.id.progress_bar);
//        btn1.setOnClickListener(this);

    }

//    @Override
//    public void onClick(View v) {
//        switch (v.getId()){
//            case R.id.button_1:
//                // 显示输入的文本
//                //String inputText = editText.getText().toString();
//                //Toast.makeText(MainActivity.this, inputText, Toast.LENGTH_SHORT).show();
//                // do something
//
//                // 切换图片
//
//                // imageView.setImageResource(R.drawable.test2);
//
//                // 显示进度条
////                if(progressBar.getVisibility() == View.GONE){
////                    progressBar.setVisibility(View.VISIBLE);
////                }else{
////                    progressBar.setVisibility(View.GONE);
////                }
//
////                int progress = progressBar.getProgress();
////                progress += 10;
////                progressBar.setProgress(progress);
//
//                // 警告窗口
////                AlertDialog.Builder alertDialog = new AlertDialog.Builder(MainActivity.this);
////                alertDialog.setTitle("警告");
////                alertDialog.setMessage("重要提示");
////                alertDialog.setCancelable(false);
////                alertDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
////                    @Override
////                    public void onClick(DialogInterface dialog, int which) {
////
////                    }
////                });
////                alertDialog.setNegativeButton("CANCEL", new DialogInterface.OnClickListener() {
////                    @Override
////                    public void onClick(DialogInterface dialog, int which) {
////
////                    }
////                });
////                alertDialog.show();
//
//                ProgressDialog progressDialog = new ProgressDialog(MainActivity.this);
//                progressDialog.setTitle("This is ProgressDialog");
//                progressDialog.setMessage("Loading");
//                progressDialog.show();
//                break;
//            default:
//                break;
//        }
//    }
}
